using System;
using System.Collections.Generic;
using System.Text;

using NHibernate;
using Framework.Library.Domain;
using Framework.Library.Base;

namespace Framework.Library.DAO
{
    public partial interface IPortalModulecontrolManager : IManagerBase<PortalModulecontrol, int>
    {
		// Get Methods
		IList<PortalModulecontrol> GetByModuleID(System.Int32 moduleID);
    }

    partial class PortalModulecontrolManager : ManagerBase<PortalModulecontrol, int>, IPortalModulecontrolManager
    {
		#region Constructors
		
		public PortalModulecontrolManager() : base()
        {
        }
        public PortalModulecontrolManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<PortalModulecontrol> GetByModuleID(System.Int32 moduleID)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(PortalModulecontrol));
			
			ICriteria portalModuleCriteria = criteria.CreateCriteria("PortalModule");
            portalModuleCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", moduleID));
			
			return criteria.List<PortalModulecontrol>();
        }
		
		#endregion
    }
}